package com.freeman.cement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.freeman.cement.entity.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface MessageDao extends BaseMapper<Message> {
    int addMessage(Message msg);
    //消息读取次数自动加1
    //update message set readtimes=readtimes+1 where id = 974;
    int readTimesAddOne(@Param("id") int id);
    List<Message> selectMessagesByReceiver(@Param("receiveDutyId") Integer receiveDutyId, @Param("readtimes") Integer readtimes, @Param("after") Date after);
}
